import os
import sys
from distutils.core import setup
import py2exe
import pygame
import pymunk
from glob import glob

pymunk_dir = os.path.dirname(pymunk.__file__)
pygame_dir = "C:\\Python27\\Lib\\site-packages\\pygame\\"

origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
    if os.path.basename(pathname).lower() in ("libogg-0.dll", "sdl_ttf.dll", "sdl.dll", "sel_mixer.dll", "sdl_image.dll", "fftpack_lite.pyd", "msvcr71.dll"):
        return 0
    return origIsSystemDLL(pathname)

py2exe.build_exe.isSystemDLL = isSystemDLL


data_files = [
    os.path.join(pymunk_dir, 'chipmunk.dll'),
    os.path.join(pygame_dir, "freesansbold.ttf"),
    os.path.join(pygame_dir, "sdl.dll"),
    os.path.join(pygame_dir, "sdl_ttf.dll"),
    os.path.join(pygame_dir, "libfreetype-6.dll"),
    os.path.join(pygame_dir, "zlib1.dll"),
    ("data", glob(r'C:\Users\sether\Documents\dat\taxtris\data\*.*')),
    "msvcr71.dll"
    ]

setup(console=['taxtris.py'],
      data_files = data_files
      )
